package com.baitiaojun.moments.api;

import com.baitiaojun.api.domain.moments.UserDailyMoments;
import com.baitiaojun.api.domain.moments.UserMomentsStatus;
import com.baitiaojun.api.exception.ConditionException;
import com.baitiaojun.api.util.ConstantUtil;
import com.baitiaojun.api.vo.JsonRes;
import com.baitiaojun.api.vo.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * @类名 MessageController
 * @作者 白条君
 * @创建日期 2022/11/27 14:43
 * @版本 1.0
 */
@Api("动态接口")
@RequestMapping("/moments")
public interface UserMomentsApi {

    @ApiOperation("粉丝查看关注用户发布的动态")
    @GetMapping("/search-moments")
    PageInfo getSubscribedMoments(@RequestParam(defaultValue = ConstantUtil.USER_MOMENTS_PAGE_NO) Integer pageNo,
                                  @RequestParam(defaultValue = ConstantUtil.USER_MOMENTS_PAGE_SIZE) Integer pageSize) throws Exception;

    @ApiOperation("查看自己的动态或者是查看其他用户的动态，查看自己的动态只需要token，查看其他用户的动态只需要userInfoId")
    @GetMapping("/search-current-user-moments")
    JsonRes getCurrentUserMoments(@RequestParam(defaultValue = ConstantUtil.USER_MOMENTS_PAGE_NO) Integer pageNo,
                           @RequestParam(defaultValue = ConstantUtil.USER_MOMENTS_PAGE_SIZE) Integer pageSize,
                           Long userInfoId) throws Exception;

    @ApiOperation("删除动态")
    @DeleteMapping("/cancel-user-moments")
    JsonRes cancelMoments(@ApiParam(value = "动态id") @RequestParam Long id) throws Exception;

    @ApiOperation(value = "添加动态状态", hidden = true)
    @PostMapping("/save-moments-status")
    JsonRes addMomentsStatus(@RequestBody UserMomentsStatus momentsStatus) throws ConditionException;

    @ApiOperation(value = "获取动态数量", hidden = true)
    @GetMapping("/moments-count")
    Integer getMomentsCount(@RequestParam Long userId);
}